from django.db import models


class TrainCourse(models.Model):
    course_name = models.CharField('培训班名称', max_length=120, null=True)
    course_status = models.CharField('培训班状态', max_length=12, null=False,default="进行中")
    course_modality = models.CharField('培训班形式', max_length=50, null=True)
    course_type = models.CharField('培训班类型', max_length=50, null=True)
    course_start_time = models.DateField("培训开始时间", null=True)
    course_end_time = models.DateField("培训结束时间", null=True)
    sponsor_type = models.CharField('主办单位类型', max_length=50, null=True)
    sponsor = models.TextField('主办单位', null=True)
    organizer = models.CharField('承办单位', max_length=50, null=True)
    total_day = models.IntegerField('合计天数', null=True)
    person_count = models.IntegerField('人数', null=True)
    course_site = models.CharField('培训地点', max_length=50, null=True)
    user1_id = models.CharField('班主任1id', max_length=50, null=True)
    user1_name = models.CharField('班主任1名称', max_length=50, null=True)
    # 改动===================
    credentials = models.BooleanField('是否有证书', null=False, default=True)
    user2_id = models.CharField('班主任2id', max_length=50, null=True)
    user2_name = models.CharField('班主任2名称', max_length=50, null=True)

    class Meta():
        db_table = 'train_course'


class TrainCourseExpense(models.Model):
    train_course_id = models.CharField('培训班ID', max_length=12, null=True)
    course_site_rent = models.CharField('培训会场租金', max_length=12, null=True)
    course_meal_fee = models.CharField('培训餐费', max_length=12, null=True)
    management_cost = models.CharField('培训管理费', max_length=12, null=True)
    courseware_cost = models.CharField('视频课件制作费', max_length=12, null=True)
    printing_fee = models.CharField('资料打印费', max_length=12, null=True)
    car_fare = models.CharField('老师及工作人员交通费', max_length=12, null=True)
    quarterage = models.CharField('老师及工作人员住宿费', max_length=12, null=True)
    file_bag_fee = models.CharField('资料袋套装', max_length=12, null=True)
    tea_break_fee = models.CharField('茶歇费', max_length=12, null=True)
    other_fee = models.CharField('其他费用', max_length=12, null=True)
    other_fee_remark = models.TextField('其他费用备注', null=True)
    tax = models.CharField('开票税额', max_length=12, null=True)
    train_course_total_cost = models.CharField('培训班总费用', max_length=50, null=True)
    personal_train_expense = models.CharField('实收学员培训费', max_length=50, null=True)

    class Meta():
        db_table = 'train_course_expense'

class TrainCourseTeacherExpense(models.Model):
    train_course_id = models.CharField('培训班ID', max_length=12, null=True)
    train_course_content = models.CharField('培训课程内容', max_length=50, null=True)
    teacher_id = models.CharField('讲师ID', max_length=12, null=True)
    teacher_name = models.CharField('讲师名称', max_length=12, null=True)
    teacher_expense = models.CharField('课酬总价', max_length=12, null=True)
    # 改动===================
    course_count = models.CharField('课时', max_length=12, null=True)
    teacher_unit_expense = models.CharField('课酬单价', max_length=50, null=True)
    is_total = models.BooleanField('是/否一口价', max_length=12, null=True, default=True)


    class Meta():
        db_table = 'train_course_teacher_expense'

class TrainCourseTrainee(models.Model):
    train_course_id = models.CharField('培训班ID', max_length=12, null=True)
    name = models.CharField('学员姓名', max_length=50, null=True)
    gender = models.CharField('性别', max_length=50, null=True)
    source = models.CharField('来源', max_length=50, null=True)
    unit_name = models.CharField('所在单位', max_length=50, null=True)
    branch = models.CharField('部门', max_length=50, null=True)
    post = models.CharField('职务', max_length=50, null=True)
    phone_num = models.CharField('手机号', max_length=50, null=True)
    jcc_num = models.CharField('交建通账号', max_length=50, null=True)
    remark = models.CharField('备注', max_length=50, null=True)
    # 改动===================
    course_ids = models.CharField('课程id', max_length=50, null=True)
    credentials_num = models.CharField('证书编号',max_length=120, null=True)
    personal_train_expense = models.CharField('实收学员培训费', max_length=50, null=True)

    class Meta():
        db_table = 'train_course_trainee'
